<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('修改消毒记录')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-ncXiaoduLogs-edit" th:object="${ncXiaoduLogs}">
			<input id="treeId" name="xdClassname" type="hidden"/>
			<input id="xdDeptname" name="xdDeptname" type="hidden"/>
            <input id="xdId" name="xdId" th:field="*{xdId}"  type="hidden">
			<input id="teamId" name="teamId" type="hidden" value="100"/>
			<div class="form-group">	
				<label class="col-sm-3 control-label">消毒位置：</label>
				<div class="col-sm-8">
					<input id="xdPlace" name="xdPlace" th:field="*{xdPlace}" class="form-control" type="text" required>
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">消毒方式：</label>
				<div class="col-sm-8">
					<select name="xdType" required class="form-control m-b"
							th:with="type=${@dict.getType('xiaoduType')}">
						<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{xdType}"></option>
					</select>
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">消毒内容：</label>
				<div class="col-sm-8">
					<input id="xdInfo" name="xdInfo" th:field="*{xdInfo}" class="form-control" type="text" required>
				</div>
			</div>
			<!--<div class="form-group">
				<label class="col-sm-3 control-label">消毒人id：</label>
				<div class="col-sm-8">
					<input id="xdUser" name="xdUser" th:field="*{xdUser}" class="form-control" type="text">
				</div>
			</div>-->
			<div class="form-group">	
				<label class="col-sm-3 control-label">消毒人：</label>
				<div class="col-sm-8">
					<input id="xdUsername" name="xdUsername" class="form-control"  type="text" th:field="*{xdUsername}">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">班组：</label>
				<div class="col-sm-8">
					<div class="input-group">
						<input class="form-control" type="text" onclick="selectDeptTree()" id="treeName" readonly="true" name="name"  th:value="*{xdDeptname}">
						<span class="input-group-addon"><i class="fa fa-search"></i></span>
					</div>
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">消毒时间：</label>
				<div class="col-sm-8">

						<input type="text" style="height: 34px;"  th:value="*{#dates.format(xdTime, 'yyyy-MM-dd HH:mm:ss')}" name="xdTime" class="time-input" id="xdTime" data-type="datetime"/>

				</div>
			</div>
			<!--<div class="form-group">
				<label class="col-sm-3 control-label">创建时间：</label>
				<div class="col-sm-8">
					<input id="createTime" name="createTime" th:field="*{createTime}" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">创建者：</label>
				<div class="col-sm-8">
					<input id="createBy" name="createBy" th:field="*{createBy}" class="form-control" type="text">
				</div>
			</div>-->
			<div class="form-group">	
				<label class="col-sm-3 control-label">备注：</label>
				<div class="col-sm-8">
					<textarea id="remark" name="remark" th:field="*{remark}" class="form-control valid" type="text" rows="4"></textarea>
				</div>
			</div>
		</form>
    </div>
    <div th:include="include::footer"></div>
    <script type="text/javascript">
		var prefix = ctx + "system/ncXiaoduLogs";
		$("#form-ncXiaoduLogs-edit").validate({
			rules:{
				xxxx:{
					required:true,
				},
			},
			focusCleanup: true
		});

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-ncXiaoduLogs-edit').serialize());
            }
        }
        /*部门管理-新增-选择父部门树*/
        function selectDeptTree() {
            var deptId = $.common.isEmpty($("#treeId").val()) ? "100" : $("#treeId").val();
            var options = {
                title: '部门选择',
                width: "380",
				url : ctx + "system/dept/selectDeptTree/" + deptId + "?level=1&rank=2&"+'parentIds=101,208',
                callBack: doSubmit
            };
            $.modal.openOptions(options);
        }

        function doSubmit(index, layero){
            var tree = layero.find("iframe")[0].contentWindow.$._tree;
            if ($.tree.notAllowParents(tree)) {
                var body = layer.getChildFrame('body', index);
                $("#treeId").val(body.find('#treeId').val());
                $("#xdDeptname").val(body.find('#treeName').val());
                $("#treeName").val(body.find('#treeName').val());
                layer.close(index);
            }
        }
	</script>
</body>
</html>
